<fieldset>
	<legend><?php echo t('PART_WORKING_PROCESS','profile') ?></legend>
	<table width="970px">
		<tr>
			<td width="50%" style="vertical-align: top">
				<div class="cbaddnew">
					<a href="javascript:void(0);" class="button"
						id="loadWorkingProcessByAjax"><?php echo t('BTN_ADDNEW', 'workingProcess'); ?></a>
				</div>
				<table class="grid working" id="workingprocesses">
					<tbody>
						<tr>
							<th rowspan="2"><?php echo t('LBL_WORKING_TIME', 'workingProcess') ?></th>
							<th rowspan="2"><?php echo t('LBL_COMPANY', 'workingProcess') ?></th>
							<th rowspan="2"><?php echo t('LBL_JOB_DESCRIPTION', 'workingProcess') ?></th>
							<th colspan="2"><?php echo t('LBL_SALARY', 'workingProcess') ?></th>
							<th rowspan="2" class="hideonview"></th>
						</tr>
						<tr>
							<th><?php echo t('LBL_BASIC_SALARY', 'workingProcess') ?></th>
							<th><?php echo t('LBL_REAL_SALARY', 'workingProcess') ?></th>
						</tr>
						<?php
						$workingIndex = 0;
						foreach ( $model->workingProcesses as $workingId => $work ) :
							if ($work != null) {
								$this->renderPartial ( '/workingprocess/_form', array (
										'model' => $work,
										'index' => $workingId 
								) );
								$workingIndex++;
							}
						endforeach
						;
						?>
					</tbody>
				</table>
			</td>
	
	</table>
</fieldset>
<?php
Yii::app ()->clientScript->registerScript ( 'loadworkingprocess', '
var _workingIndex = ' . $workingIndex . ';
$("#loadWorkingProcessByAjax").click(function(e){
    e.preventDefault();
    var _url = "' . Yii::app ()->controller->createUrl ( "loadWorkingProcessByAjax", array (
		"load_for" => $this->action->id 
) ) . '&index="+_workingIndex;
    $.ajax({
        url: _url,
        success:function(response){
            $("#workingprocesses").append(response);            
        }
    });
    _workingIndex++;
});
', CClientScript::POS_END );
?>